package com.geezdata.cps.sdk3rd.youzan.request;

import java.util.HashMap;
import java.util.Map;

import com.geezdata.cps.sdk3rd.youzan.constant.Constants;
import com.geezdata.cps.sdk3rd.youzan.response.YouzanTradeGetResult;

public class YouzanTradeGetRequest extends YouzanRequest<YouzanTradeGetResult> {
    // 需要返回的交易对象字段，如tid,title,receiver_city等。
    // 可选值：TradeDetail交易结构体中所有字段均可返回；多个字段用“,”分隔。如果为空则返回所有
	private String fields; 
	
	private String tid; // 交易编号
	
	private Long subTradePageNo ; // 指定获取子交易的第几页，不传则获取全部
	
	private Long subTradePageSize;  // 指定获取子交易每页条数，不传则获取全部，上限500
	
	{
		methodName = Constants.METHOD_YOUZAN_TRADE_GET;
	}
	
	public String getFields() {
        return fields;
    }

    public void setFields(String fields) {
        this.fields = fields;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public Long getSubTradePageNo() {
        return subTradePageNo;
    }

    public void setSubTradePageNo(Long subTradePageNo) {
        this.subTradePageNo = subTradePageNo;
    }

    public Long getSubTradePageSize() {
        return subTradePageSize;
    }

    public void setSubTradePageSize(Long subTradePageSize) {
        this.subTradePageSize = subTradePageSize;
    }

	@Override
	public Map<String, Object> getAppParams() {
	    Map<String, Object> httpParams = new HashMap<String, Object>();
	    httpParams.put("fields", this.fields);
	    httpParams.put("tid", this.tid);
	    httpParams.put("page_no", this.subTradePageNo);
	    httpParams.put("page_size", this.subTradePageSize);
        return httpParams;
	}
	
    @Override
	public Class<YouzanTradeGetResult> getResponseClass() {
		return YouzanTradeGetResult.class;
	}
}

    
    
